package me.moscrop.RootCommand.utilities;

import org.bukkit.entity.Player;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;


public class Chat {
	
	public static void messageAll(Player player, String raw) {
			
		Player[] Plist = Bukkit.getServer().getOnlinePlayers();
		for(Player players : Plist){
		    
			players.sendMessage(getPlayerNameStyle(player) + ChatColor.WHITE + raw);
		}
			
	}
	
	public static void message(Player player, String raw) {
		String Sender = getPlayerNameStyle(player);
		
		player.sendMessage(Sender + ": " + ChatColor.WHITE + raw);
	}
	
	
	public static String getPlayerNameStyle(Player player) {
		
		String worldName = player.getWorld().getName();
		String playername = player.getDisplayName();
		
		
		return ChatColor.DARK_GRAY + "[" + ChatColor.WHITE + worldName + ChatColor.DARK_GRAY + "]" + ChatColor.BLUE + playername;
	}
	
}
